package com.het.monitor.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.het.monitor.mapper.AppConfMapper;
import com.het.monitor.task.model.AppConf;
import com.het.monitor.service.AppConfService;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AppConfServiceImpl extends ServiceImpl<AppConfMapper, AppConf> implements AppConfService {
    @Override
    public List<AppConf> getAreaTypeList(String areaType, Integer parentId) {
        QueryWrapper queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("area_type", areaType);
        queryWrapper.eq("parent_id", parentId);
        queryWrapper.eq("status",1);
        queryWrapper.orderByAsc("id");
        return this.baseMapper.selectList(queryWrapper);
    }

    @Override
    public List<AppConf> getAreaTypeList(String areaType) {
        QueryWrapper queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("area_type", areaType);
        queryWrapper.eq("status",1);
        queryWrapper.orderByAsc("id");
        return this.baseMapper.selectList(queryWrapper);
    }
}
